'use strict';

/**
 * @param {Egg.Application} app - egg application
*/
module.exports = app => {
  const {
    router,
    controller,
  } = app;

  // router.get('/', controller.home.index);

  //banner 
  router.get('getBanner', '/user/getBanner', controller.banner.getBanner);
  router.post('updateBanner', '/api/updateBanner', controller.banner.UspdateBanner);

  // api
  router.resources('users', '/api/users', controller.users);
  router.get('logout', '/api/logout', controller.users.logout);
  router.post('login', '/user/login', controller.users.login);
  router.get('info', '/api/info', controller.users.info);

  //work
  router.post("delWork","/api/DelWork",controller.works.DelWork)
  router.post("work",'/user/work', controller.works.getList)
  router.post("updateWork",'/api/updateWork',controller.works.UspdateWork)
  router.post("CreateWork",'/api/CreateWork',controller.works.CreateWork)
  router.post("getDetailWorl",'/api/getDetailWorl',controller.works.getDetailWorl)
  // spider
  router.get('spider', '/spider', controller.spider.get_data);


  //device 
  router.get("getDevice",'/user/getDevice',controller.device.getDevice)
  router.post("UspdateDevice",'/api/UspdateDevice',controller.device.UspdateDevice)
  router.post("CreateDevice",'/api/CreateDevice',controller.device.CreateDevice)
  router.post("DeleteDevice", '/api/DeleteDevice',controller.device.DeleteDevice)
  //upload img 
  router.post("uploadImg","/user/uploadImg",controller.upload.uploadSaveLocal)
};
